package com.example.houqin_oa.controller;

import com.example.comment_oa.pojos.rear.Details;
import com.example.comment_oa.pojos.rear.Entrepot;
import com.example.comment_oa.pojos.rear.Pos;
import com.example.comment_oa.pojos_vo.LogisticsVo.EntrepotVo;
import com.example.comment_oa.response.AjaxResponse;
import com.example.houqin_oa.service.EntrepotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:仓库
 * @Author:陈旭良
 * @Documents_And_Settings:liang
 * @Date:2022-11-23 18:07
 * @Entry_Name:my_springcloud_project01cangku
 */
@RestController
@CrossOrigin
@RequestMapping("/houqinOa")
public class EntrepotController {

    @Autowired
    EntrepotService entrepotService;

    //仓库查询
    @PostMapping("/entrepot/AllEntrepot")
    public AjaxResponse AllEntrepot(@RequestBody Entrepot entrepot){
        return AjaxResponse.success(entrepotService.AllEntrepot(entrepot));
    }
    //仓库报损
    @PostMapping("/entrepot/Breakage")
    public AjaxResponse Breakage(@RequestBody EntrepotVo entrepotVo){
        return AjaxResponse.success(entrepotService.Breakage(entrepotVo));
    }

    //仓库报溢
    @PostMapping("/entrepot/Overflow")
    public AjaxResponse Overflow(@RequestBody EntrepotVo entrepotVo){
        return AjaxResponse.success(entrepotService.Overflow(entrepotVo));
    }

    //仓库添加
    @PostMapping("/entrepot/addEntrepot")
    public AjaxResponse addEntrepot(@RequestBody Pos pos){
        return AjaxResponse.success(entrepotService.addEntrepot(pos));
    }

}
